package com.mobilesales.android.infrastructure;

import java.util.*;

import com.mobilesales.android.R;

import android.content.Context;
import android.widget.ArrayAdapter;

public class MenuBuilder {

	private Context ctx;
	private List<MenuItem> items; 
	
	public MenuBuilder(Context ctx) {
		this.ctx = ctx;
		this.items = new ArrayList<MenuItem>();
	}
	
	public MenuBuilder addItem(MenuItem item) {
		this.items.add(item);
		return this;
	}
	
	public ArrayAdapter<MenuItem> build() {
		return new ArrayAdapter<MenuItem>(ctx, R.layout.menu_item, R.id.menuItemLabel, items);
	}
}
